/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MenuPrincipal.java
 *
 * Created on 17/02/2011, 10:36:22 AM
 */

package Pantallas;

import Clases.Estudiante;
import Clases.Profesor;
import Clases.Seccion;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

/**
 *
 * @author Reinaldo Carvallo
 */
public class MenuPrincipal extends javax.swing.JFrame {
    String status,cedula,cedula1,cedula2,nombre2,nombre3,titulo_academico,nombre;
    int nota_final,cantidad_estudiantes;
    static Profesor p1;
    static  Seccion s1;
         static int [] notas_parciales= new int [4];
    static Estudiante e1=new Estudiante("", "", 0, notas_parciales, "");


    /** Creates new form MenuPrincipal */
    public MenuPrincipal() throws IOException {
        initComponents();
        status="";
		cantidad_estudiantes=0;
		status="";
		cedula="";
		nombre2="";
		cedula1="";
		cedula2="";
		nombre3="";
		titulo_academico="";
		nombre="";
        p1 =  new Profesor(cedula,nombre2,titulo_academico);
        s1 = new Seccion(nombre,cantidad_estudiantes);
        e1 = new Estudiante(cedula1,nombre3,nota_final,notas_parciales,status);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        btnCargarSeccion = new javax.swing.JButton();
        btnAsignarProfesor = new javax.swing.JButton();
        btnInscribirEstudiante = new javax.swing.JButton();
        btnRetirarEstudiante = new javax.swing.JButton();
        btnBuscarEstudiante = new javax.swing.JButton();
        btnProcesarEvaluaciones = new javax.swing.JButton();
        btnListaEstudianteCedula = new javax.swing.JButton();
        btnListaEstudianteNota = new javax.swing.JButton();
        btnListaEstudiantesReprobados = new javax.swing.JButton();
        btnListaEstudiantesAprobados = new javax.swing.JButton();
        btnSalir = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(null);

        jLabel1.setText("Menu principal");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(260, 20, 130, 20);

        btnCargarSeccion.setText("1. cargar Secion");
        btnCargarSeccion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCargarSeccionActionPerformed(evt);
            }
        });
        getContentPane().add(btnCargarSeccion);
        btnCargarSeccion.setBounds(20, 50, 250, 23);

        btnAsignarProfesor.setText("2. Asignar Profesor");
        btnAsignarProfesor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAsignarProfesorActionPerformed(evt);
            }
        });
        getContentPane().add(btnAsignarProfesor);
        btnAsignarProfesor.setBounds(300, 50, 250, 23);

        btnInscribirEstudiante.setText("3.Inscribir estudiante");
        btnInscribirEstudiante.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnInscribirEstudianteActionPerformed(evt);
            }
        });
        getContentPane().add(btnInscribirEstudiante);
        btnInscribirEstudiante.setBounds(20, 90, 250, 23);

        btnRetirarEstudiante.setText("4.Retirar Estudiante");
        btnRetirarEstudiante.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnRetirarEstudianteActionPerformed(evt);
            }
        });
        getContentPane().add(btnRetirarEstudiante);
        btnRetirarEstudiante.setBounds(300, 90, 250, 23);

        btnBuscarEstudiante.setText("5.Buscar Estudiante");
        btnBuscarEstudiante.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarEstudianteActionPerformed(evt);
            }
        });
        getContentPane().add(btnBuscarEstudiante);
        btnBuscarEstudiante.setBounds(20, 130, 250, 23);

        btnProcesarEvaluaciones.setText("6.Procesar Evaluaciones");
        btnProcesarEvaluaciones.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnProcesarEvaluacionesActionPerformed(evt);
            }
        });
        getContentPane().add(btnProcesarEvaluaciones);
        btnProcesarEvaluaciones.setBounds(300, 130, 250, 23);

        btnListaEstudianteCedula.setText("7.Listado de Estudiantes por Cedula");
        btnListaEstudianteCedula.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnListaEstudianteCedulaActionPerformed(evt);
            }
        });
        getContentPane().add(btnListaEstudianteCedula);
        btnListaEstudianteCedula.setBounds(20, 170, 250, 23);

        btnListaEstudianteNota.setText("8.Listado de Estudiantes por Nota");
        btnListaEstudianteNota.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnListaEstudianteNotaActionPerformed(evt);
            }
        });
        getContentPane().add(btnListaEstudianteNota);
        btnListaEstudianteNota.setBounds(300, 170, 250, 23);

        btnListaEstudiantesReprobados.setText("9.Listado de Estudiantes Reprobados");
        btnListaEstudiantesReprobados.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnListaEstudiantesReprobadosActionPerformed(evt);
            }
        });
        getContentPane().add(btnListaEstudiantesReprobados);
        btnListaEstudiantesReprobados.setBounds(20, 210, 250, 23);

        btnListaEstudiantesAprobados.setText("10.Listado de Estudiantes Aprobados");
        btnListaEstudiantesAprobados.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnListaEstudiantesAprobadosActionPerformed(evt);
            }
        });
        getContentPane().add(btnListaEstudiantesAprobados);
        btnListaEstudiantesAprobados.setBounds(300, 210, 250, 23);

        btnSalir.setText("Salir");
        btnSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSalirActionPerformed(evt);
            }
        });
        getContentPane().add(btnSalir);
        btnSalir.setBounds(230, 270, 130, 23);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-600)/2, (screenSize.height-360)/2, 600, 360);
    }// </editor-fold>//GEN-END:initComponents

    private void btnCargarSeccionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCargarSeccionActionPerformed
        // TODO add your handling code here:
        CargarSeccion pantalla1 = new CargarSeccion();
        pantalla1.show();

}//GEN-LAST:event_btnCargarSeccionActionPerformed

    private void btnAsignarProfesorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAsignarProfesorActionPerformed
        // TODO add your handling code here:
        AsignarProfesor pantalla2 = new AsignarProfesor();
        pantalla2.show();

}//GEN-LAST:event_btnAsignarProfesorActionPerformed

    private void btnInscribirEstudianteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInscribirEstudianteActionPerformed
        // TODO add your handling code here:
        InscribirEstudiante pantalla3 = new InscribirEstudiante();
        pantalla3.show();
}//GEN-LAST:event_btnInscribirEstudianteActionPerformed

    private void btnRetirarEstudianteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRetirarEstudianteActionPerformed
        // TODO add your handling code here:
        RetirarEstudiante pantalla4 = new RetirarEstudiante();
        pantalla4.show();
}//GEN-LAST:event_btnRetirarEstudianteActionPerformed

    private void btnBuscarEstudianteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarEstudianteActionPerformed
        // TODO add your handling code here:
        BuscarEstudiante pantalla5 = new BuscarEstudiante();
        pantalla5.show();
}//GEN-LAST:event_btnBuscarEstudianteActionPerformed

    private void btnProcesarEvaluacionesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProcesarEvaluacionesActionPerformed
        // TODO add your handling code here:
       MenuPrincipal.s1.Evaluacion_Estudiantes(p1, e1);
       JOptionPane.showMessageDialog(new JFrame()," Las evaluaciones se realizaron exitosamente ","Error",JOptionPane.CANCEL_OPTION);
}//GEN-LAST:event_btnProcesarEvaluacionesActionPerformed

    private void btnListaEstudianteCedulaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnListaEstudianteCedulaActionPerformed
        // TODO add your handling code here:
        ListaEstudianteCedula pantalla7 = new ListaEstudianteCedula();
        pantalla7.show();
        
}//GEN-LAST:event_btnListaEstudianteCedulaActionPerformed

    private void btnListaEstudianteNotaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnListaEstudianteNotaActionPerformed
        // TODO add your handling code here:
        ListaEstudianteNotas  pantalla8 = new ListaEstudianteNotas();
        pantalla8.show();
    }//GEN-LAST:event_btnListaEstudianteNotaActionPerformed

    private void btnListaEstudiantesReprobadosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnListaEstudiantesReprobadosActionPerformed
        // TODO add your handling code here:
        ListaEstudiantesReprobados pantalla9 = new ListaEstudiantesReprobados();
        pantalla9.show();
    }//GEN-LAST:event_btnListaEstudiantesReprobadosActionPerformed

    private void btnListaEstudiantesAprobadosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnListaEstudiantesAprobadosActionPerformed
        // TODO add your handling code here:
        ListaEstudiantesAprobados pantalla10 = new ListaEstudiantesAprobados();
        pantalla10.show();
    }//GEN-LAST:event_btnListaEstudiantesAprobadosActionPerformed

    private void btnSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalirActionPerformed
        // TODO add your handling code here:
        dispose();
    }//GEN-LAST:event_btnSalirActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    new MenuPrincipal().setVisible(true);
                } catch (IOException ex) {
                    Logger.getLogger(MenuPrincipal.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAsignarProfesor;
    private javax.swing.JButton btnBuscarEstudiante;
    private javax.swing.JButton btnCargarSeccion;
    private javax.swing.JButton btnInscribirEstudiante;
    private javax.swing.JButton btnListaEstudianteCedula;
    private javax.swing.JButton btnListaEstudianteNota;
    private javax.swing.JButton btnListaEstudiantesAprobados;
    private javax.swing.JButton btnListaEstudiantesReprobados;
    private javax.swing.JButton btnProcesarEvaluaciones;
    private javax.swing.JButton btnRetirarEstudiante;
    private javax.swing.JButton btnSalir;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables

}
